Define the data structure and API