Move upload and wait into API class