600% nicer api with test for imap server