properly normalize links when api and frontend are served from the same domain