Replace $entity and $entities vars with the variables based on entity name in the controller and template files.