add constructor that takes json. add equals and hashcode