Move the sleep in test_api