Setup url rewrite for api