api: implement vote delegation and related test case