Adding retries to REST calls