add base api and generic type method for all general restful api.

i will be pride of this code.