finished the API