fix bug with value and key-value endings

fix bug with incorect parsing of [1, 2, 3, ] and {"a" : "b", }