Added database retrieval
Refactored code
Added folder for uploads