Cleaning up error handling in CGI functions - they now send back