Basic tests for the API (metadata/ and data/)

With fixes for some of the error cases.

Also, normalized of paths coming from backend configuration.