Added error checking and ensuring users own objects they are trying to edit