Finished fromJson code.