adding testDb
refactoring controller