Add basic api. Fix temp var bug in func call.