Added some more dao functions

The main one is an example of some untestable code that is in dire need
of refactoring, so will be a good example.