Added Database functions for querying. Needs implementation.