add docs / fix some api