Rewriting bits of API DAO test code Part of #790