Restful factory for AngularJS.