ajax_demo: modified code to follow standard guidelines