Refactor controllers to use models instead of ids