Based on d3-server-side-demo with new modifications