[api] CONFIG is always defined - fix the apiversion
[api] simplify xpath error handling and fix the test cases

The test cases did test something invalid