working simulation with ajax and node.js