implemented the API