Better handle HTTP errors that happen with the API