add some configurarion and separe api