add model and controller for services; general refactoring