lib: move public api to api.rs