improve email api