Cleaned up index.js
Added sockets with ajax backup