rest service for angularJS