You might want to replace contact.print(); with return contact;

// Json