         base64-image   (:base64Image params)
         url            (:url params)
         description    (:description params)]
-    (if-let [error-message (get-update-errors institution-id user-id name description)]
+    (if-let [error-message (or (get-common-errors name description)
+                               (get-update-errors institution-id user-id name))]
       (data-response error-message)
       (do
         (call-sql "update_institution" institution-id name url description)

    (> (count description) max-description-length)
    (str "Institution description must not exceed " max-description-length " characters.")))

(defn- get-create-errors [name description]
  (let [input-error (check-inputs name description)]
    (cond
      input-error
      input-error

      (sql-primitive (call-sql "institution_name_taken" name -1))
      (str "Institution with the name " name " already exists."))))

(defn create-institution [{:keys [params]}]
  (let [user-id      (:userId params -1)

          (doseq [admin-id (set [user-id 1])]
            (call-sql "add_institution_user" institution-id admin-id 1))
          (data-response institution-id))
        (data-response "Unknown server error.")))))

(defn- get-update-errors [institution-id user-id name]
  (cond
    (nil? (first (call-sql "select_institution_by_id" institution-id user-id)))
    (str "Institution " institution-id " is not found.")

    (sql-primitive (call-sql "institution_name_taken" name institution-id))
    (str "Institution with the name " name " already exists.")))

(defn update-institution [{:keys [params]}]
  (let [user-id        (:userId params -1)
