moved functions from controller to a service
Merge pull request #2 from mclise/service-assignment

moved functions from controller to a service