Added ajax handling implementation