Redesigned the HTTP<->API mapping.

Comments would be appreciated. @okrieg, @pjd, @henn