clean up api calls by using ng-resource