moved response handling into the client region, removed handleResponse()