Move variables to variables.js and add api endpoint