Add an apiVersion method to simplify providing APIs

Fixes #4438