Refactor request handling.
Add html handler.