Re-implemented the server script to better present a valid http response.