implemented ajax using json responses