Now checking the JSON response for an error key before parsing further.
This should fix a couple of the crashes