Update ajax.php

Describe AJAX processing logic