ajax_demo: changed code to follow guidelines