public static String createContact(String name, String email, String publicKey, String memo) {

        String contactID = "error";
        System.out.println("in createContact");
        AddressBook addressBook = Helpers.getAddressBook();
        if (addressBook == null) {
            System.out.println("createContact - addressBook returns null");
            return contactID;
        }
        System.out.println("in createContact,addressBook:"+addressBook);
        Storable storable = otapi.CreateObject(StoredObjectType.STORED_OBJ_CONTACT);
        System.out.println("in createContact, storable:"+storable);
        if (storable != null) {
            Contact contact = Contact.ot_dynamic_cast(storable);
            System.out.println("contact:"+contact);
            if (contact != null) {
                contact.setContact_id(Helpers.generateID());
                contact.setEmail(email);
                contact.setGui_label(name);
                contact.setMemo(memo);
                contact.setPublic_key(publicKey);
                boolean status = addressBook.AddContact(contact);
                System.out.println("status addressBook.AddContact:" + status);
                if (!status) {
                    return contactID;
                }
                status = otapi.StoreObject(addressBook, "moneychanger", "gui_contacts.dat");
                System.out.println("status addressBook otapi.StoreObject:" + status);
                if (!status) {
                    return contactID;
                }
                contactID = Helpers.generateID();
            }
        }
        return contactID;
    }