Change in base model to include hasMany nesteds in JSON only if hasMany is not empty