Add front-end code to implement AJAX