Americans detained in Iran to be freed after $6 billion deal