Added initial and untested work on ajax.php