More functions for the AJAX controller.