Use ngResource.