move controller out of server.js example