Implemented update and insert methods.