Fixed field value serialization issue.

Now item fields are serialized correctly to JSON, containing
the corresponding values as well.

Fixes: #3026