Support multi-tenanted APIs, don't cache base_path.

Fixes #167.