developing ajax function

most of the ajax function works, need further development