[api] Added --debug option.