changed nature of AJAX call code

Signed-off-by: Nicholas Headlong <nicholas.headlong@hogarthww.com>