use $http instead of $.ajax post request