Coredata API service for AngularJS