Fix RPC handlers to use the results of lookupLedger.