public void updateApi(String organizationId, String apiId, UpdateApiBean bean)
        throws ApiNotFoundException, NotAuthorizedException {

        tryAction(() -> {
            ApiBean apiForUpdate = getApiFromStorage(organizationId, apiId);
            EntityUpdatedData auditData = new EntityUpdatedData();
            if (AuditUtils.valueChanged(apiForUpdate.getDescription(), bean.getDescription())) {
                auditData.addChange("description", apiForUpdate.getDescription(), bean.getDescription()); //$NON-NLS-1$
                apiForUpdate.setDescription(bean.getDescription());
            }
            if (AuditUtils.valueChanged(apiForUpdate.getImage(), bean.getImage())) {
                auditData.addChange("image", apiForUpdate.getImage(), bean.getImage());
                // Remove old image
                if (apiForUpdate.getImage() != null) {
                    blobStore.remove(apiForUpdate.getImage());
                }
                // Attach to new image
                apiForUpdate.setImage(bean.getImage());
                if (bean.getImage() != null) {
                    blobStore.attachToBlob(bean.getImage());
                }
            }
            if (AuditUtils.valueChanged(tagMapper.toDto(apiForUpdate.getTags()), bean.getTags())) {
                // TODO(msavy): add audit entry.
                // auditData.addChange("tags", apiForUpdate.getTags(), bean.getTags());
                apiForUpdate.setTags(tagMapper.toEntity(bean.getTags()));
            }
            storage.updateApi(apiForUpdate);
            storage.createAuditEntry(AuditUtils.apiUpdated(apiForUpdate, auditData, securityContext));
        });
    }
Gets the API from storage
@param organizationId the organizationId
@param apiId the apiId
@return the api
@throws ApiNotFoundException if the API is not found
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ApiService.java