ajax_demo: modified code to follow guidelines