closing http response (with defer)