Added some extra error debug info
Added support so whole database object can be fetched instead of having to call a model.