Added batching to the API. In theory