Rewrite using REST API