[WIP] data structures for resources

This PR introduced some data structure to represent resources.
I'd prefer to see purely descriptive types, in the style of api/types.go. In fact, why not move ```Resource``` and ```ResourceType``` there?