API: improved email system