Fix test_api.py.