Added some query functions to the DB