Refactored tests, added behavior to services and detached data access layer from the controller