This works for me-
addToDbReturnJson::(ToJSON val, PersistEntity val,
(PersistEntityBackend val ~ PersistMonadBackend (YesodDB App)))=>val->Handler Value
Not very intuitive, but it looks to me like the in the last part you have to specify that the database that the input value connects to is the same database that the handler uses (.... OK, that makes sense I guess).