public String ProcessTransaction(HttpMethod httpMethod, String url,
			Object data) throws BeanstreamApiException {
    
        try {
            
            Gson gson = getGsonBuilder().create();
            String json = data != null ? gson.toJson(data) : null;
            
            // this is a temporary println while SDK is in development
            /*if (data != null) {
                Gson gsonpp = getGsonBuilder().setPrettyPrinting().create();
                System.out.println("Request data.....................\n"+gsonpp.toJson(data));
            }*/
            
            ResponseHandler<BeanstreamResponse> responseHandler = new ResponseHandler<BeanstreamResponse>() {
                @Override
                public BeanstreamResponse handleResponse(final HttpResponse http)
                        throws ClientProtocolException, IOException {
                    return BeanstreamResponse.fromHttpResponse(http);
                }
            };
            
            HttpUriRequest http = null;
                
            switch(httpMethod) {
                case post: {
                    StringEntity entity = new StringEntity(json);
                    http = new HttpPost(url);
                    ((HttpPost) http).setEntity(entity);
                    break;
                }
                case put: {
                    StringEntity entity = new StringEntity(json);
                    http = new HttpPut(url);
                    ((HttpPut) http).setEntity(entity);
                    break;
                }
                case get: {
                    http = new HttpGet(url);
                    break;
                }
                case delete: {
                    http = new HttpDelete(url);
                    break;
                }
            }

            BeanstreamResponse bsRes = process(http, responseHandler);
            int httpStatus = bsRes.getHttpStatusCode();
            if (httpStatus >= 200 && httpStatus < 300) {
                return bsRes.getResponseBody();
            } else {
                throw mappedException(httpStatus, bsRes);
            }

        } catch (UnsupportedEncodingException ex) {
            throw handleException(ex, null);
            
        } catch (IOException ex) {
            throw handleException(ex, null);
        } 

    }