Managing relay in an API engine