Created controller and main method.