Pass base urls to the API app

This gives the API a simple way of knowing where the main application
is hosted and where the API is mounted within it. This is
used to generate links in the API output.
Merge pull request #301 from mysociety/api-base-url

Pass base urls to the API app