Implement some tests for AgentAPI (2)

This one should work with the newest agent model, too.