Pass base url to the API

This gives the API a simple way of knowing where it's mounted within the
main popit application. This is used to generate links in the API
output.