Create MainController
Fixed errors