Added edit and update functionality for gadgets.