Added a trait to get meaningful errors when json has problems. It is sure to be used in other parts of code