API v2 - specify API version via headers or in urls2

original PR is #3431. it was closed because the `engine` branch has now been merged
into `master`.