refactored error handling in food item service