bit of a clean up

added the beginning of AJAX response handler