Switch from $.ajax to $http