add stacktrace_to_json & unittest