Ensure correct encoding, set content type, enable CORS, add JSONP support