Deleting collections and removing api.close() in favor of process.exit() in tasks