Actually Implemented file creation in the controller