Fix some bugs in exported APIs.
Finished the implementation of exported APIs.