Extracts files API logic into a module and fixes dist version of the app