moving ajax code to io.js. will write iostatic later