An endpoint resolver for AngularJS