Refactored: lock/unlock middlewares are in a separate controller
Refactored: getDoc middlewares moved to the utils controller
Refactored: using one 'deleteFiles' helper for all controllers
Refactored: moved permission checking to the utils controller
Linted
Moved: helpers in a separate helper file