Implementing JSON communication