Error handling and basic documentation