some changes for controllers and service (AngularJS)