Fix - Custom objects cannot be serialized in JSON

Custom objects cannot be serialized in JSON, convert tasks into list before serializing.