allow specifying custom base URL for testing/mocking

If you need an idea for how to test this, let me know.