email api endpoint working