Fix test failures caused by 586574ba

This redelaration of api_do shadowed the correct one.