Have the batch import endpoint manage its own transactions based on which database is running.

Explicitly roll back the transaction on error.
Merge pull request #473 from hudmol/batch-import-transactions

Have the batch import endpoint manage its own transactions