move main.rs to lib.rs
public api ready