server side code and fix index.html