Fixes #7307 - Refactor errata/package/package group APIs

Original task was to add missing params to the package group API but noticing some similarities among packages/errata/package groups APIs, I made the code more DRY as well.
by having 2 different index methods doesn't the apipie doc for the index action get included twice? (or am i remembering incorrectl).