refact teach api