moved routes and server to module and fixed unset resource on dispacth