added JSON parser code