moved format responses to http\response object