Output attributes and metadata separately in json