Make API test more robust.