build model and controllers