Added new functionality to the database.  More robust queries using try/catch statements.