refactored curlProxy to include http response codes