Handle errors coming back from the API