Add magic methods to Resource class