added trimResponse(response)