created function to read json data