Added more structure to the API stuff