[test] add test code for APIRequest()