introduced proper json message handling

Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>