add JSON encoder and delete contact function