new ability to parse json from string
added debug output
minor fix