renamed endBatch to sendBatch for RPC batching
minor refactoring: organized imports