split TextApi into TextRead and TextWrite