change the API, add the tests