Handle different resource types. Closes #17