Added database setup and teardown
Fixed back code