Fixed some bugs with pathing when running at other endpoints (eg, */api)