convert to express.js for http handling