Update api to make it more modular