Added data handling through AJAX