Changed JSON messages and some code fixes