Add AJAX for function