refactor - Use Array.select instead of manually pushing values to array
fix - Topic reference was expected at the wrong JSON node. Fixed it.
fix - Return the generated json object at the end of Topic#as_json