added some json building stuff in files.js