FIX json object construction

- plgenerator: updates whole json construction procedure to include metadata
- inserts tracks to DB