Added a proper json parser for incoming messages