Fix failing tests in test-api