This is ugly but I don't know why in some cases client is undefined and then we cannot access its c.apiUrl parameter.