Add basic error handling
Add basic support for resources