create ajax request handler