Separate a part of code in server.go to package 'controller'.