refactor respond, res.status= and res.body=

defer status and body check into `application.respond`, fix some edge cases.

see the added test cases.