MT#3925 Return json error for 403/404 on /api/.+

Return as usual a json struct with code and message under the /api/ path.
Otherwise an API client would get the html pages, which is
pretty pointless.
MT#3933 API: Implement subscriber preferences.

While at it, combine preference handling for subscribers, domains
and peers into a single role.