Reimplemented solution for #102 so it's backwards compatible with older clients.
At the same time this fixes #191 by only adding the extra search criteria when the API version is 4 or higher.