API: create API methods and adapt tests.