Change get_transaction to handle errors, return json