Also catch AttributeError since it is possible to not get back JSON data. Fixes #457

This PR also catches AttributeError for those times when JSON data is not returned from the API.

Fixes #457