Retry failed request

Added functionality to retry failed requests with ConnectionError exceptions as well as functions to set the pause between retries and maximum number of retries.