fixed issues related to uploads and downloads

Also fixed templates