Throw exception when trying to add a code with identical details to an existing code (stops duplication of codes during migration), safely handle duplicate groups (same Name) using similar check to codes, removes 500 error on group creation during migration