Fix error handling for ratings API