Updating the code to create and edit the device type