Log and end response when request is ended