Convert to JSON if needed.

If the webserver don't serve the file as JSON, but as text, parse it to extract
a JSON object.