improving api structure