refactored backend to correctly save files to gridfs
updated frontend to match backend