A really hacky way to retry API requests on an error response