updated docs and internal apis