US Secretary of State John Kerry says the peaceful release of US sailors by Iran is a testament to diplomacy.