made ajaxCall function for generalized purpose