print api res: always allow result to be undef if optional