add javascript objects and initial ajax functionality