Use handlers

Convert the current server implementation to only use handlers.