[api] move common relationship related functions into a mixin
[api] move rendering of project and package meta into a view