Should we move it in the ResourceController and tweak it a little bit for being it more generic ?