Install imap extension with pecl instead of apt-get.
Fix api doc links.