Adding support for redirecting via API