add listBatches function to index.js with associated tests