Added error message for malformatted api response