Set the content type of the response. Added some more comments.