code: public <T> T performGetRequest(String url, Class<T> returnType, Map<String, String> uriVariables) {
  
          int tryNumber = 1;
          while(tryNumber <= API_RETRY) {
              try {
                  return restTemplate.getForObject(url, returnType, uriVariables);
              } catch (HttpStatusCodeException error) {
                  boolean isTooManyRequestsError = handleHttpStatusCodeError(uriVariables, tryNumber, error);
                  if (isTooManyRequestsError) {
                      try {
                          Thread.sleep(1000);
                      } catch (InterruptedException e) {
                          log.error("Error in performGetRequest", e);
                      }
                  } else {
                      tryNumber++;
                  }
              } catch (Exception e) {
                  handleApiError(tryNumber, e);
                  tryNumber++;
              }
          }
  
          throw new RestApiException("Error getting " + returnType.getSimpleName() + " url variables " + uriVariables.toString());
  
      }
docs: /*
  *************************************************************************
  
  Methods making the actual REST calls.
  
  *************************************************************************