fixed json doc, and improvement result type safe