Improve resources API
Add tests to check resources management API