updated api to have rating json representation