Fixed db.api... Starting to fix unit tests...