DB Casts within history api.

    For better compatibilty across the db layers and types,
    cast the parameters appropriately