Adding new wrapping function for dir assignation

- Adds a new wrapping function for the storage directory assignation
- Changes check_resource and get_resource_id methods to functions
- Improves code in error message handling