Added the CGI script to respond with JSON for the AJAX call