implemented reading from json