Major refactor of the API refactor