reorganize api and examples