implementing the api