Added common ajax request function and callFunction methods