Derive base URI from the request unless given

Fixes #2