API-related cleanups extracted from AppResource

Each of these commits should make sense by itself, so if you comment on the commit I won't complain ;-)

Getting this merged will make the AppResource PR smaller.