code: public JSONObject processAPIRequest(
  			String urlString,
  			JSONObject request,
  			String requestType, 
  			String[] requestParameters,
  			String... requestHedaers) throws CertificateException, IOException, JSONException {
  		resetRequestScenarioVariables();
  		
  		String response = null;
  		
  		GenericUser authenticationUser = (GenericUser) getScenarioGlobals().getAttribute(API_AUTHENTICATION_USER);
  		
  		if(BROWSER_API_ACCESS_MODE.equals(getAPIAccessMode())) {
  			response = processBrowserAPIRequest(urlString, request, requestType, requestParameters);
  		}
  		else {
  			response = processHTTPAPIRequest(urlString, request, authenticationUser, requestType, requestParameters, requestHedaers);			
  		}
  		
  		JSONObject responseJSON = null;
  		
  		try{
  			if(!StringUtils.isBlank(response)) {
  				responseJSON = new JSONObject(response);
  				log.debug("API JSON response: " + responseJSON.toString(4));
  			}				
  		}
  		catch(JSONException ex) {
  			fail("Contructing the JSON respose failed with: " + ex.getLocalizedMessage() + "\n\nResponse: " + response);
  		}
  		getScenarioGlobals().setAttribute(APIAccessService.LAST_SCENARIO_JSON_RESPONSE_KEY, responseJSON);
  		return responseJSON;
  	}
docs: Process the {@link JSONObject} request
  
  @param urlString
  @param request
  @param requestType
  @param requestHedaers
  @return {@link JSONObject}
  @throws CertificateException
  @throws IOException
  @throws JSONException