fix tests in api_test.go