api_direction can work, need more tweaks on repr()

Signed-off-by: shzeng <shuai.zeng@outlook.com>