added tests and monitoring of database existence