Use app.restApiRoot

This pull request contains commits from #9 relevant to the new config option `restApiRoot`.

/to: @ritch please review.