Case API - Fix undefined index