Email api

Minor fixes