Added tests with database operation
Fixed scenarios using db