wait for api port after restart