set up ajax, added get and post to js