Fix POST work
Restructure server.js so the frontend can be used as a module too (for openshift tests