Minor Bugfixes

Fixed some bugs, and preparing the upload API to manage file extensions.