api call to save rating