Added ajax function and test index