Added edit and update functions along with tests