some refactor #10
complete api #10