@Override
	@SuppressWarnings("unchecked")
	protected <E> E getApiResponse(AbstractContentHandler contentHandler, InputStream inputStream, Class<E> clazz) throws ApiException {
		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
		if (logger.isInfoEnabled()) {
			inputStream = new InputStreamSplitter(inputStream, outputStream);
		}
		try {
			SAXParserFactory spf = SAXParserFactory.newInstance(); 
		    SAXParser sp = spf.newSAXParser(); 
		    XMLReader xr = sp.getXMLReader(); 
		    xr.setContentHandler(contentHandler); 
		    xr.parse(new InputSource(inputStream)); 
			return (E) contentHandler.getResponse();
		} catch (Exception e) {
			throw new ApiException(e);
		} finally {
			logger.info("\nResponse:\n" + outputStream.toString());
		}
	}