flatten a json object from multiple layer to one layer