Split up the server side code so that the HTML demo still works.