Updated spa.js for app init