Add automatic validation in repository controller