build controller and routing