Add Content-Length to the API response headers

I had an application that was having issues with these responses because they didn't include a Content-Length header in the response.

I've changed the code to use implicit headers using ```setHeader()``` instead of ```writeHead()``` and added code to set the ```Content-Length``` header after we have the JSON response.