Fix ApiServer for stdin, stdout.