Change request method from http post to ajax api