Added callback to createAjaxCallback function and modified createAjaxFunction.