API proxying + relativeUrlRoot

As you can see at a glance, this code is getting SUPER DUPER UGLY.

We need to refactor the heck out of this server task if it's ever going
to change significantly.

Fixes #189 cc/@bdoyle @diminish7
0.27.1