This is back in place and tested.
A slightly more standardized approach was utilized for templates/ui (html base href in head), but borrowed from your original idea to pass in the base of the api through the data- attrib.