Removed setting attribute of file
Refactored database calls
task2 switches for testing db