Automation of ids in every body

`resource` must be defined in controller as a public attribute