added code to read json message from localhost