Implemented update and delete. Also did some refactoring.
Client emits now  events e.g. for logging purposes.