Resource-like factory for MongoLab based on $http and working with promises