public function actionSave()
 {
     $id = isset($_POST['BeaconPins']['id']) ? $_POST['BeaconPins']['id'] : null;
     $model = BeaconPins::findOne(['id' => $id]);
     if (!$model instanceof BeaconPins) {
         $model = new BeaconPins();
     }
     if ($model->load(Yii::$app->request->post())) {
         if ($model->save()) {
             Yii::$app->response->format = Response::FORMAT_JSON;
             return ['success' => true];
         } else {
             throw new ServerErrorHttpException('Pin not saved');
         }
     } else {
         throw new ServerErrorHttpException('Pin not saved');
     }
 }