make data type of Resource a generic type