refactored interfaces, add api doc