code a api call test case