Refactored server code to controllers and wired up proxy support