fix api + tests