[lib] cleanup of api and docs