refactor http response