added basic infrastructure for AJAX logging [to finish]