added tests for ajax functionality