Added a catch for the ValueError that is raised when a request from the API is not in JSON format