Abstracted getK2Json function