Rewrite REST API functionality