check, if API response is really JSON

There was no check, if the API actually returned valid JSON.