moving AJAX requests into extension