Move from $http to $resource REST service