[Issue #91] cleanup and add some JS apis