Fix Bug 885883 - Return JSON objects for API request fails rather than hitting our error page when request in headers