Move control flow logic into controllers, business logic into lib
not using mongo server