New tests and API implementation