Replaced dummy code with real AJAX code