fixed compatibility with v2 /agents API