Refactored backend transactions. All transactions now in background thread.