Remove debugging code
Add basic AJAX error handling