getDataByKey takes key apart from path as an argument