Added the model and some part of the controller