public function sendArrayError(array $errors)
    {
        Yii::$app->response->setStatusCode(422, 'Data Validation Failed.');
        $result = [];
        foreach ($errors as $key => $value) {
            $messages = (array) $value;
            
            foreach ($messages as $msg) {
                $result[] = ['field' => $key, 'message' => $msg];
            }
        }
        
        return $result;
    }