routing and controller logic for express 3.x