generalizing commonly used way of fetching strings from json