port ajax method to CI