Updating ajax.php error handling and mail headers