finished the core of controller and view rendering