added models and controllers
code with before error present