Made api object be worker-dependent