add resource base api
make ResourceBase a polymorphic model