Server and controller route handler refactor