add api functions

API to rst --- first cut.