Have the batch import endpoint manage its own transactions

This should ensure that everything gets rolled back under MySQL when things go wrong.

Assigning to @lcdhoffman