Support callbacks in newResource
Merge pull request #548 from DenisIzmaylov/patch-1

Support callbacks in newResource