code: private static MPApiResponse callApi(
              HttpMethod httpMethod,
              String path,
              PayloadType payloadType,
              JsonObject payload,
              Collection<Header> colHeaders,
              int retries,
              int connectionTimeout,
              int socketTimeout,
              Boolean useCache) throws MPException {
  
          String cacheKey = httpMethod.toString() + "_" + path;
  
          MPApiResponse response = null;
          if (useCache) {
              response = MPCache.getFromCache(cacheKey);
          }
          if (response == null) {
              response = new MPRestClient().executeRequest(
                      httpMethod,
                      path,
                      payloadType,
                      payload,
                      colHeaders,
                      retries,
                      connectionTimeout,
                      socketTimeout);
  
              if (useCache) {
                  MPCache.addToCache(cacheKey, response);
              } else {
                  MPCache.removeFromCache(cacheKey);
              }
          }
  
          return response;
      }
docs: Calls the api and returns an MPApiResponse.
  
  @param httpMethod                    the http method to be processed
  @param path                          a String with the full url of the endpoint
  @param payloadType                   a PayloadType obj
  @param payload                       a JsonObject with the content of the payload
  @param colHeaders                    a collection of headers
  @param retries                       int with nrs of retries
  @param connectionTimeout             int with the connection timeout
  @param socketTimeout                 int with the socket timeout
  @param useCache                      a Boolean flag that indicates if the cache must be used
  @return
  @throws MPException