Implemented retrying of requests when they time out or other error.