I would recommend using libks for json code, and if you switch to use websockets it has an implementation for that as well.