Defines ngResource, Trying to implement ajax calls via factories.