Updated controller and model in order to make the has_many thorugh updates to work