define the api