Moved some of the tests to the API library and adapted to the latest
library changes.