Change $http factory to a service