Add ModelResource and related testcases