Added AJAX functionalities