Replacing $resource with $http implementation.