Modify controller and model to get it working with update action

[Skip ci]