added ajax (hopefully)

Attempted merge of ajax code