reorganize the api setup for future scaling and development style; first passing test