refactored proxy to use httpclient