AngularJS: Service with resource and promise