Fixed all methods to use the AngularJS Promise Api.