changed ajax to objects