Remove some 'print' here and there
Removed unused functions
Add exception management: upload_file function throws exception