work on js client to support batching