Resource is mandatory field
Add and calculate entity_count field to Resource object