Rewriting endpoint