AJAX error handling and 404 page