fixed bug with file uploads saving to the server by moving logic for saving files into the upload route