Add new APIs for text input