Add database state checking
Add support for requesting backup and restore