adding parent child logic to models and controllers