Transaction management and more robust error handling. This should get
rid of the DatabaseErrors being thrown on live.