move agent api from agent-rest-api to rest-api