Implemented CGI handler for APIs