Angularjs: backend query with $resource