diff --git a/bin/download_manager.py b/bin/download_manager.py
index 06e8773..35859a5 100755
--- a/bin/download_manager.py
+++ b/bin/download_manager.py
@@ -21,7 +21,7 @@
 	def __init__(self,bus,name):
 		dbus.service.Object.__init__(self,bus,name)
 		bus.add_signal_receiver(self.DownloadHandler, 
-			dbus_interface = "org.openbmc.Flash", signal_name = "Download")
+			dbus_interface = "org.openbmc.Flash", signal_name = "Download", path_keyword = "path")
 
 	@dbus.service.signal(DBUS_NAME,signature='ss')
 	def DownloadComplete(self,outfile,filename):
@@ -32,19 +32,22 @@
 	def DownloadError(self,filename):
 		pass
 
-	def DownloadHandler(self,url,filename):
+	def DownloadHandler(self,url,filename,path = None):
 		try:
 			filename = str(filename)
 			client = tftpy.TftpClient(url, TFTP_PORT)
 			print "Downloading: "+filename+" from "+url
 			outfile = System.FLASH_DOWNLOAD_PATH+"/"+filename
 			client.download(filename,outfile)
-			self.DownloadComplete(outfile,filename)
+			obj = bus.get_object("org.openbmc.control.Flash",path)
+			intf = dbus.Interface(obj,"org.openbmc.Flash")
+			intf.update(outfile)
 					
 		except Exception as e:
 			print "ERROR DownloadManager: "+str(e)
-			self.DownloadError(filename)
-	
+			obj = bus.get_object("org.openbmc.control.Flash",path)
+			intf = dbus.Interface(obj,"org.openbmc.Flash")
+			intf.error("Download Error: "+filename)
 
 
 if __name__ == '__main__':
diff --git a/interfaces/openbmc_intf.c b/interfaces/openbmc_intf.c
index f1e0c95..b7d9501 100644
--- a/interfaces/openbmc_intf.c
+++ b/interfaces/openbmc_intf.c
@@ -19003,6 +19003,49 @@
   FALSE
 };
 
+static const _ExtendedGDBusArgInfo _flash_method_info_error_IN_ARG_message =
+{
+  {
+    -1,
+    (gchar *) "message",
+    (gchar *) "s",
+    NULL
+  },
+  FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _flash_method_info_error_IN_ARG_pointers[] =
+{
+  &_flash_method_info_error_IN_ARG_message,
+  NULL
+};
+
+static const _ExtendedGDBusMethodInfo _flash_method_info_error =
+{
+  {
+    -1,
+    (gchar *) "error",
+    (GDBusArgInfo **) &_flash_method_info_error_IN_ARG_pointers,
+    NULL,
+    NULL
+  },
+  "handle-error",
+  FALSE
+};
+
+static const _ExtendedGDBusMethodInfo _flash_method_info_done =
+{
+  {
+    -1,
+    (gchar *) "done",
+    NULL,
+    NULL,
+    NULL
+  },
+  "handle-done",
+  FALSE
+};
+
 static const _ExtendedGDBusArgInfo _flash_method_info_update_via_tftp_IN_ARG_url =
 {
   {
@@ -19061,6 +19104,8 @@
 static const _ExtendedGDBusMethodInfo * const _flash_method_info_pointers[] =
 {
   &_flash_method_info_update,
+  &_flash_method_info_error,
+  &_flash_method_info_done,
   &_flash_method_info_update_via_tftp,
   &_flash_method_info_init,
   NULL
@@ -19176,12 +19221,26 @@
   FALSE
 };
 
+static const _ExtendedGDBusPropertyInfo _flash_property_info_status =
+{
+  {
+    -1,
+    (gchar *) "status",
+    (gchar *) "s",
+    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
+    NULL
+  },
+  "status",
+  FALSE
+};
+
 static const _ExtendedGDBusPropertyInfo * const _flash_property_info_pointers[] =
 {
   &_flash_property_info_filename,
   &_flash_property_info_flasher_path,
   &_flash_property_info_flasher_name,
   &_flash_property_info_flasher_instance,
+  &_flash_property_info_status,
   NULL
 };
 
@@ -19229,6 +19288,7 @@
   g_object_class_override_property (klass, property_id_begin++, "flasher-path");
   g_object_class_override_property (klass, property_id_begin++, "flasher-name");
   g_object_class_override_property (klass, property_id_begin++, "flasher-instance");
+  g_object_class_override_property (klass, property_id_begin++, "status");
   return property_id_begin - 1;
 }
 
@@ -19243,6 +19303,8 @@
 /**
  * FlashIface:
  * @parent_iface: The parent interface.
+ * @handle_done: Handler for the #Flash::handle-done signal.
+ * @handle_error: Handler for the #Flash::handle-error signal.
  * @handle_init: Handler for the #Flash::handle-init signal.
  * @handle_update: Handler for the #Flash::handle-update signal.
  * @handle_update_via_tftp: Handler for the #Flash::handle-update-via-tftp signal.
@@ -19250,6 +19312,7 @@
  * @get_flasher_instance: Getter for the #Flash:flasher-instance property.
  * @get_flasher_name: Getter for the #Flash:flasher-name property.
  * @get_flasher_path: Getter for the #Flash:flasher-path property.
+ * @get_status: Getter for the #Flash:status property.
  * @download: Handler for the #Flash::download signal.
  * @updated: Handler for the #Flash::updated signal.
  *
@@ -19287,6 +19350,51 @@
     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
 
   /**
+   * Flash::handle-error:
+   * @object: A #Flash.
+   * @invocation: A #GDBusMethodInvocation.
+   * @arg_message: Argument passed by remote caller.
+   *
+   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Flash.error">error()</link> D-Bus method.
+   *
+   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call flash_complete_error() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+   *
+   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+   */
+  g_signal_new ("handle-error",
+    G_TYPE_FROM_INTERFACE (iface),
+    G_SIGNAL_RUN_LAST,
+    G_STRUCT_OFFSET (FlashIface, handle_error),
+    g_signal_accumulator_true_handled,
+    NULL,
+    g_cclosure_marshal_generic,
+    G_TYPE_BOOLEAN,
+    2,
+    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
+
+  /**
+   * Flash::handle-done:
+   * @object: A #Flash.
+   * @invocation: A #GDBusMethodInvocation.
+   *
+   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-Flash.done">done()</link> D-Bus method.
+   *
+   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call flash_complete_done() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+   *
+   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+   */
+  g_signal_new ("handle-done",
+    G_TYPE_FROM_INTERFACE (iface),
+    G_SIGNAL_RUN_LAST,
+    G_STRUCT_OFFSET (FlashIface, handle_done),
+    g_signal_accumulator_true_handled,
+    NULL,
+    g_cclosure_marshal_generic,
+    G_TYPE_BOOLEAN,
+    1,
+    G_TYPE_DBUS_METHOD_INVOCATION);
+
+  /**
    * Flash::handle-update-via-tftp:
    * @object: A #Flash.
    * @invocation: A #GDBusMethodInvocation.
@@ -19408,6 +19516,15 @@
    */
   g_object_interface_install_property (iface,
     g_param_spec_string ("flasher-instance", "flasher_instance", "flasher_instance", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+  /**
+   * Flash:status:
+   *
+   * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-Flash.status">"status"</link>.
+   *
+   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
+   */
+  g_object_interface_install_property (iface,
+    g_param_spec_string ("status", "status", "status", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 }
 
 /**
@@ -19615,6 +19732,57 @@
 }
 
 /**
+ * flash_get_status: (skip)
+ * @object: A #Flash.
+ *
+ * Gets the value of the <link linkend="gdbus-property-org-openbmc-Flash.status">"status"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use flash_dup_status() if on another thread.</warning>
+ *
+ * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
+ */
+const gchar *
+flash_get_status (Flash *object)
+{
+  return FLASH_GET_IFACE (object)->get_status (object);
+}
+
+/**
+ * flash_dup_status: (skip)
+ * @object: A #Flash.
+ *
+ * Gets a copy of the <link linkend="gdbus-property-org-openbmc-Flash.status">"status"</link> D-Bus property.
+ *
+ * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
+ *
+ * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
+ */
+gchar *
+flash_dup_status (Flash *object)
+{
+  gchar *value;
+  g_object_get (G_OBJECT (object), "status", &value, NULL);
+  return value;
+}
+
+/**
+ * flash_set_status: (skip)
+ * @object: A #Flash.
+ * @value: The value to set.
+ *
+ * Sets the <link linkend="gdbus-property-org-openbmc-Flash.status">"status"</link> D-Bus property to @value.
+ *
+ * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
+ */
+void
+flash_set_status (Flash *object, const gchar *value)
+{
+  g_object_set (G_OBJECT (object), "status", value, NULL);
+}
+
+/**
  * flash_emit_updated:
  * @object: A #Flash.
  *
@@ -19743,6 +19911,196 @@
 }
 
 /**
+ * flash_call_error:
+ * @proxy: A #FlashProxy.
+ * @arg_message: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.error">error()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_call_error_finish() to get the result of the operation.
+ *
+ * See flash_call_error_sync() for the synchronous, blocking version of this method.
+ */
+void
+flash_call_error (
+    Flash *proxy,
+    const gchar *arg_message,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data)
+{
+  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+    "error",
+    g_variant_new ("(s)",
+                   arg_message),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    callback,
+    user_data);
+}
+
+/**
+ * flash_call_error_finish:
+ * @proxy: A #FlashProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_call_error().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with flash_call_error().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_error_finish (
+    Flash *proxy,
+    GAsyncResult *res,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+/**
+ * flash_call_error_sync:
+ * @proxy: A #FlashProxy.
+ * @arg_message: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.error">error()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See flash_call_error() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_error_sync (
+    Flash *proxy,
+    const gchar *arg_message,
+    GCancellable *cancellable,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+    "error",
+    g_variant_new ("(s)",
+                   arg_message),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+/**
+ * flash_call_done:
+ * @proxy: A #FlashProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.done">done()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call flash_call_done_finish() to get the result of the operation.
+ *
+ * See flash_call_done_sync() for the synchronous, blocking version of this method.
+ */
+void
+flash_call_done (
+    Flash *proxy,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data)
+{
+  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+    "done",
+    g_variant_new ("()"),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    callback,
+    user_data);
+}
+
+/**
+ * flash_call_done_finish:
+ * @proxy: A #FlashProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to flash_call_done().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with flash_call_done().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_done_finish (
+    Flash *proxy,
+    GAsyncResult *res,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+/**
+ * flash_call_done_sync:
+ * @proxy: A #FlashProxy.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-Flash.done">done()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See flash_call_done() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+flash_call_done_sync (
+    Flash *proxy,
+    GCancellable *cancellable,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+    "done",
+    g_variant_new ("()"),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+/**
  * flash_call_update_via_tftp:
  * @proxy: A #FlashProxy.
  * @arg_url: Argument to pass with the method invocation.
@@ -19957,6 +20315,42 @@
 }
 
 /**
+ * flash_complete_error:
+ * @object: A #Flash.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Flash.error">error()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+flash_complete_error (
+    Flash *object,
+    GDBusMethodInvocation *invocation)
+{
+  g_dbus_method_invocation_return_value (invocation,
+    g_variant_new ("()"));
+}
+
+/**
+ * flash_complete_done:
+ * @object: A #Flash.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-Flash.done">done()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+flash_complete_done (
+    Flash *object,
+    GDBusMethodInvocation *invocation)
+{
+  g_dbus_method_invocation_return_value (invocation,
+    g_variant_new ("()"));
+}
+
+/**
  * flash_complete_update_via_tftp:
  * @object: A #Flash.
  * @invocation: (transfer full): A #GDBusMethodInvocation.
@@ -20040,7 +20434,7 @@
 {
   const _ExtendedGDBusPropertyInfo *info;
   GVariant *variant;
-  g_assert (prop_id != 0 && prop_id - 1 < 4);
+  g_assert (prop_id != 0 && prop_id - 1 < 5);
   info = _flash_property_info_pointers[prop_id - 1];
   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
   if (info->use_gvariant)
@@ -20087,7 +20481,7 @@
 {
   const _ExtendedGDBusPropertyInfo *info;
   GVariant *variant;
-  g_assert (prop_id != 0 && prop_id - 1 < 4);
+  g_assert (prop_id != 0 && prop_id - 1 < 5);
   info = _flash_property_info_pointers[prop_id - 1];
   variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
   g_dbus_proxy_call (G_DBUS_PROXY (object),
@@ -20229,6 +20623,21 @@
   return value;
 }
 
+static const gchar *
+flash_proxy_get_status (Flash *object)
+{
+  FlashProxy *proxy = FLASH_PROXY (object);
+  GVariant *variant;
+  const gchar *value = NULL;
+  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "status");
+  if (variant != NULL)
+    {
+      value = g_variant_get_string (variant, NULL);
+      g_variant_unref (variant);
+    }
+  return value;
+}
+
 static void
 flash_proxy_init (FlashProxy *proxy)
 {
@@ -20270,6 +20679,7 @@
   iface->get_flasher_path = flash_proxy_get_flasher_path;
   iface->get_flasher_name = flash_proxy_get_flasher_name;
   iface->get_flasher_instance = flash_proxy_get_flasher_instance;
+  iface->get_status = flash_proxy_get_status;
 }
 
 /**
@@ -20744,7 +21154,7 @@
 {
   FlashSkeleton *skeleton = FLASH_SKELETON (object);
   guint n;
-  for (n = 0; n < 4; n++)
+  for (n = 0; n < 5; n++)
     g_value_unset (&skeleton->priv->properties[n]);
   g_free (skeleton->priv->properties);
   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
@@ -20762,7 +21172,7 @@
   GParamSpec   *pspec G_GNUC_UNUSED)
 {
   FlashSkeleton *skeleton = FLASH_SKELETON (object);
-  g_assert (prop_id != 0 && prop_id - 1 < 4);
+  g_assert (prop_id != 0 && prop_id - 1 < 5);
   g_mutex_lock (&skeleton->priv->lock);
   g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
   g_mutex_unlock (&skeleton->priv->lock);
@@ -20879,7 +21289,7 @@
   GParamSpec   *pspec)
 {
   FlashSkeleton *skeleton = FLASH_SKELETON (object);
-  g_assert (prop_id != 0 && prop_id - 1 < 4);
+  g_assert (prop_id != 0 && prop_id - 1 < 5);
   g_mutex_lock (&skeleton->priv->lock);
   g_object_freeze_notify (object);
   if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
@@ -20904,11 +21314,12 @@
 
   g_mutex_init (&skeleton->priv->lock);
   skeleton->priv->context = g_main_context_ref_thread_default ();
-  skeleton->priv->properties = g_new0 (GValue, 4);
+  skeleton->priv->properties = g_new0 (GValue, 5);
   g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
   g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
   g_value_init (&skeleton->priv->properties[2], G_TYPE_STRING);
   g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING);
+  g_value_init (&skeleton->priv->properties[4], G_TYPE_STRING);
 }
 
 static const gchar *
@@ -20955,6 +21366,17 @@
   return value;
 }
 
+static const gchar *
+flash_skeleton_get_status (Flash *object)
+{
+  FlashSkeleton *skeleton = FLASH_SKELETON (object);
+  const gchar *value;
+  g_mutex_lock (&skeleton->priv->lock);
+  value = g_value_get_string (&(skeleton->priv->properties[4]));
+  g_mutex_unlock (&skeleton->priv->lock);
+  return value;
+}
+
 static void
 flash_skeleton_class_init (FlashSkeletonClass *klass)
 {
@@ -20990,6 +21412,7 @@
   iface->get_flasher_path = flash_skeleton_get_flasher_path;
   iface->get_flasher_name = flash_skeleton_get_flasher_name;
   iface->get_flasher_instance = flash_skeleton_get_flasher_instance;
+  iface->get_status = flash_skeleton_get_status;
 }
 
 /**
diff --git a/interfaces/openbmc_intf.h b/interfaces/openbmc_intf.h
index ad4ea09..af80c89 100644
--- a/interfaces/openbmc_intf.h
+++ b/interfaces/openbmc_intf.h
@@ -2570,6 +2570,15 @@
 
 
 
+  gboolean (*handle_done) (
+    Flash *object,
+    GDBusMethodInvocation *invocation);
+
+  gboolean (*handle_error) (
+    Flash *object,
+    GDBusMethodInvocation *invocation,
+    const gchar *arg_message);
+
   gboolean (*handle_init) (
     Flash *object,
     GDBusMethodInvocation *invocation);
@@ -2593,6 +2602,8 @@
 
   const gchar * (*get_flasher_path) (Flash *object);
 
+  const gchar * (*get_status) (Flash *object);
+
   void (*download) (
     Flash *object,
     const gchar *arg_url,
@@ -2614,6 +2625,14 @@
     Flash *object,
     GDBusMethodInvocation *invocation);
 
+void flash_complete_error (
+    Flash *object,
+    GDBusMethodInvocation *invocation);
+
+void flash_complete_done (
+    Flash *object,
+    GDBusMethodInvocation *invocation);
+
 void flash_complete_update_via_tftp (
     Flash *object,
     GDBusMethodInvocation *invocation);
@@ -2654,6 +2673,40 @@
     GCancellable *cancellable,
     GError **error);
 
+void flash_call_error (
+    Flash *proxy,
+    const gchar *arg_message,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data);
+
+gboolean flash_call_error_finish (
+    Flash *proxy,
+    GAsyncResult *res,
+    GError **error);
+
+gboolean flash_call_error_sync (
+    Flash *proxy,
+    const gchar *arg_message,
+    GCancellable *cancellable,
+    GError **error);
+
+void flash_call_done (
+    Flash *proxy,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data);
+
+gboolean flash_call_done_finish (
+    Flash *proxy,
+    GAsyncResult *res,
+    GError **error);
+
+gboolean flash_call_done_sync (
+    Flash *proxy,
+    GCancellable *cancellable,
+    GError **error);
+
 void flash_call_update_via_tftp (
     Flash *proxy,
     const gchar *arg_url,
@@ -2709,6 +2762,10 @@
 gchar *flash_dup_flasher_instance (Flash *object);
 void flash_set_flasher_instance (Flash *object, const gchar *value);
 
+const gchar *flash_get_status (Flash *object);
+gchar *flash_dup_status (Flash *object);
+void flash_set_status (Flash *object, const gchar *value);
+
 
 /* ---- */
 
diff --git a/objects/flash_bios_obj.c b/objects/flash_bios_obj.c
index ebc71aa..d9ad04d 100644
--- a/objects/flash_bios_obj.c
+++ b/objects/flash_bios_obj.c
@@ -5,15 +5,15 @@
 #include "openbmc.h"
 
 /* ---------------------------------------------------------------------------------------------------- */
-static const gchar* dbus_object_path = "/org/openbmc/flash";
-static const gchar* dbus_name        = "org.openbmc.flash.Bios";
+static const gchar* dbus_object_path = "/org/openbmc/control/flash";
+static const gchar* dbus_name        = "org.openbmc.control.Flash";
 static const gchar* FLASHER_BIN      = "flasher.exe";
 static const gchar* DLOAD_BUS = "org.openbmc.managers.Download";
 static const gchar* DLOAD_OBJ = "/org/openbmc/managers/Download";
 
 static GDBusObjectManagerServer *manager = NULL;
 
-int update(Flash* flash)
+int update(Flash* flash, const char* obj_path)
 {
 	pid_t pid;
 	int status=-1;
@@ -24,7 +24,7 @@
 		const gchar* name = flash_get_flasher_name(flash);
 		const gchar* inst = flash_get_flasher_instance(flash);
 		const gchar* filename = flash_get_filename(flash);
-		status = execl(path, name, inst, filename, NULL);
+		status = execl(path, name, inst, filename, obj_path, NULL);
 		return status;
 	}
 	return 0;
@@ -38,11 +38,16 @@
 	flash_complete_init(f,invocation);
 
 	//tune flash
-	flash_set_filename(f,"");
-	int rc = update(f);
-	if (rc==-1)
+	printf(" >>>>>>>>>> %s\n",flash_get_flasher_instance(f));	
+	if (strcmp(flash_get_flasher_instance(f),"bios") == 0)
 	{
-		printf("ERROR FlashControl_0: Unable to init\n");
+		flash_set_filename(f,"");
+		const gchar* obj_path = g_dbus_object_get_object_path((GDBusObject*)user_data);
+		int rc = update(f,obj_path);
+		if (rc==-1)
+		{
+			printf("ERROR FlashControl: Unable to init\n");
+		}
 	}
 	return TRUE;
 }
@@ -110,15 +115,49 @@
 	else
 	{	
 		printf("Flashing BIOS from TFTP: %s,%s\n",url,write_file);
-		shared_resource_set_lock(lock,true);
-		shared_resource_set_name(lock,dbus_object_path);
 		flash_set_filename(flash,write_file);
 		flash_emit_download(flash,url,write_file);
+		flash_set_status(flash,"Downloading");
 	}
 	return TRUE;
 }
 
 static gboolean
+on_error        (Flash          *flash,
+                GDBusMethodInvocation  *invocation,
+                gchar*                  error_msg,
+                gpointer                user_data)
+{
+	int rc = 0;
+	SharedResource *lock = object_get_shared_resource((Object*)user_data);
+	gboolean locked = shared_resource_get_lock(lock);
+	flash_set_status(flash, error_msg);
+	flash_complete_error(flash,invocation);
+	printf("ERROR: %s.  Clearing locks\n",error_msg);
+	shared_resource_set_lock(lock,false);
+	shared_resource_set_name(lock,"");
+	
+	return TRUE;
+}
+static gboolean
+on_done        (Flash          *flash,
+                GDBusMethodInvocation  *invocation,
+                gpointer                user_data)
+{
+	int rc = 0;
+	SharedResource *lock = object_get_shared_resource((Object*)user_data);
+	gboolean locked = shared_resource_get_lock(lock);
+	flash_set_status(flash, "Flash Done");
+	flash_complete_done(flash,invocation);
+	printf("Flash Done. Clearing locks\n");
+	shared_resource_set_lock(lock,false);
+	shared_resource_set_name(lock,"");
+	
+	return TRUE;
+}
+
+
+static gboolean
 on_update (Flash          *flash,
                 GDBusMethodInvocation  *invocation,
                 gchar*                  write_file,
@@ -127,6 +166,7 @@
 	int rc = 0;
 	SharedResource *lock = object_get_shared_resource((Object*)user_data);
 	gboolean locked = shared_resource_get_lock(lock);
+	flash_set_status(flash,"Flashing");
 	flash_complete_update(flash,invocation);
 	if (locked)
 	{
@@ -136,10 +176,12 @@
 	else
 	{	
 		printf("Flashing BIOS from: %s\n",write_file);
+		flash_set_status(flash, "Flashing");
 		shared_resource_set_lock(lock,true);
 		shared_resource_set_name(lock,dbus_object_path);
 		flash_set_filename(flash,write_file);
-		rc = update(flash);
+		const gchar* obj_path = g_dbus_object_get_object_path((GDBusObject*)user_data);
+		rc = update(flash,obj_path);
 		if (!rc)
 		{
 			shared_resource_set_lock(lock,false);
@@ -148,33 +190,6 @@
 	}
 	return TRUE;
 }
-
-static void
-on_download_complete (GDBusConnection* connection,
-               const gchar* sender_name,
-               const gchar* object_path,
-               const gchar* interface_name,
-               const gchar* signal_name,
-               GVariant* parameters,
-               gpointer user_data) 
-{
-	Flash *flash = object_get_flash((Object*)user_data);
-	SharedResource *lock = object_get_shared_resource((Object*)user_data);
-
-	GVariantIter *iter = g_variant_iter_new(parameters);
-	GVariant* v_fullname = g_variant_iter_next_value(iter);
-	gsize size;
-	const gchar* fullname = g_variant_get_string(v_fullname,&size);
-	int rc;
-	flash_set_filename(flash,fullname);
-	rc = update(flash);
-	if (!rc)
-	{
-		shared_resource_set_lock(lock,false);
-		shared_resource_set_name(lock,"");
-	}
-}
-
 static void
 on_flash_progress (GDBusConnection* connection,
                const gchar* sender_name,
@@ -191,7 +206,11 @@
 	GVariant* v_progress = g_variant_iter_next_value(iter);
 	
 	uint8_t progress = g_variant_get_byte(v_progress);
-	printf("Progress: %d\n",progress);
+
+	gchar *s;
+	s = g_strdup_printf ("Flashing: %d%%",progress);
+	flash_set_status(flash,s);
+	g_free(s);
 }
 
 static void
@@ -208,6 +227,7 @@
 	printf("Flash succeeded; unlocking flash\n");
 	shared_resource_set_lock(lock,false);
 	shared_resource_set_name(lock,"");
+	flash_set_status(flash,"Flash Done");
 }
 
 static void
@@ -249,17 +269,31 @@
 {
 	ObjectSkeleton *object;
  	cmdline *cmd = user_data;
-	if (cmd->argc < 2)
-	{
-		g_print("No objects created.  Put object name(s) on command line\n");
-		return;
-	}	
   	manager = g_dbus_object_manager_server_new (dbus_object_path);
   	int i=0;
-  	for (i=1;i<cmd->argc;i++)
+
+	//TODO: don't use fixed buffer
+	char flasher_path[512];
+	memset(flasher_path, '\0', sizeof(flasher_path));
+	bool found = false;
+	gchar *flasher_file;
+	int c = strlen(cmd->argv[0]);
+	while(c>0)
+	{
+		if (cmd->argv[0][c] == '/')
+		{
+			strncpy(flasher_path,cmd->argv[0],c);
+			flasher_file = g_strdup_printf ("%s/%s",flasher_path,FLASHER_BIN);
+			break;
+		}
+		c--;
+	}
+
+	const char* inst[] = {"bios","bmc"};
+  	for (i=0;i<2;i++)
   	{
-		gchar *s;
-		s = g_strdup_printf ("%s/%s",dbus_object_path,cmd->argv[i]);
+		gchar* s;
+		s = g_strdup_printf ("%s/%s",dbus_object_path,inst[i]);
 		object = object_skeleton_new (s);
 		g_free (s);
 
@@ -274,33 +308,10 @@
 		shared_resource_set_lock(lock,false);
 		shared_resource_set_name(lock,"");
 
-		int c = strlen(cmd->argv[0]);
-
-		//TODO: don't use fixed buffer
-		char buf[512];
-		memset(buf, '\0', sizeof(buf));
-		bool found = false;
-		while(c>0)
-		{
-			if (cmd->argv[0][c] == '/')
-			{
-				strncpy(buf,cmd->argv[0],c);
-				s = g_strdup_printf ("%s/%s",buf,FLASHER_BIN);
-				break;
-			}
-			c--;
-		}
-		if (c==0)
-		{
-			printf("ERROR FlashBios: Invalid Path = %s\n",cmd->argv[0]);
-		}
-		else
-		{
-			flash_set_flasher_path(flash,s);
-			flash_set_flasher_name(flash,FLASHER_BIN);
-			flash_set_flasher_instance(flash,cmd->argv[i]);
-		}
-		g_free (s);
+		flash_set_flasher_path(flash,flasher_file);
+		flash_set_flasher_name(flash,FLASHER_BIN);
+		flash_set_flasher_instance(flash,inst[i]);
+		//g_free (s);
 
 
 		//define method callbacks here
@@ -321,6 +332,17 @@
                     "handle-update",
                     G_CALLBACK (on_update),
                     object); /* user_data */
+
+		g_signal_connect (flash,
+                    "handle-error",
+                    G_CALLBACK (on_error),
+                    object); /* user_data */
+
+		g_signal_connect (flash,
+                    "handle-done",
+                    G_CALLBACK (on_done),
+                    object); /* user_data */
+
 		g_signal_connect (flash,
                     "handle-update-via-tftp",
                     G_CALLBACK (on_update_via_tftp),
@@ -329,47 +351,9 @@
 		g_signal_connect (flash,
                     "handle-init",
                     G_CALLBACK (on_init),
-                    NULL); /* user_data */
+                    object); /* user_data */
 
-		g_dbus_connection_signal_subscribe(connection,
-				   DLOAD_BUS, DLOAD_BUS, "DownloadComplete",
-                                   DLOAD_OBJ,NULL,G_DBUS_SIGNAL_FLAGS_NONE,
-                                   (GDBusSignalCallback) on_download_complete,
-                                   object,
-                                   NULL );
-		g_dbus_connection_signal_subscribe(connection,
-				   DLOAD_BUS, DLOAD_BUS, "DownloadError",
-                                   DLOAD_OBJ,NULL,G_DBUS_SIGNAL_FLAGS_NONE,
-                                   (GDBusSignalCallback) on_download_error,
-                                   object,
-                                   NULL );
-
-		s = g_strdup_printf ("/org/openbmc/control/%s",cmd->argv[i]);
-		g_dbus_connection_signal_subscribe(connection,
-                                   NULL,
-                                   "org.openbmc.FlashControl",
-                                   "Done",
-                                   s,
-                                   NULL,
-                                   G_DBUS_SIGNAL_FLAGS_NONE,
-                                   (GDBusSignalCallback) on_flash_done,
-                                   object,
-                                   NULL );
-		g_free(s);
-		s = g_strdup_printf ("/org/openbmc/control/%s",cmd->argv[i]);
-		g_dbus_connection_signal_subscribe(connection,
-                                   NULL,
-                                   "org.openbmc.FlashControl",
-                                   "Error",
-                                   s,
-                                   NULL,
-                                   G_DBUS_SIGNAL_FLAGS_NONE,
-                                   (GDBusSignalCallback) on_flash_error,
-                                   object,
-                                   NULL );
-
-		g_free(s);
-		s = g_strdup_printf ("/org/openbmc/control/%s",cmd->argv[i]);
+		s = g_strdup_printf ("/org/openbmc/control/%s",inst[i]);
 		g_dbus_connection_signal_subscribe(connection,
                                    NULL,
                                    "org.openbmc.FlashControl",
@@ -389,7 +373,7 @@
 		g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
   		g_object_unref (object);
 	}
-
+	g_free(flasher_file);
 	/* Export all objects */
 	g_dbus_object_manager_server_set_connection (manager, connection);
 }
diff --git a/objects/flasher_obj.c b/objects/flasher_obj.c
index e951d63..53d62fd 100644
--- a/objects/flasher_obj.c
+++ b/objects/flasher_obj.c
@@ -51,6 +51,8 @@
 static const char		*fl_name;
 static int32_t			ffs_index = -1;
 
+static uint8_t FLASH_OK = 0;
+static uint8_t FLASH_ERROR = 1;
 
 static int erase_chip(void)
 {
@@ -69,6 +71,39 @@
 	return (rc);
 }
 
+void flash_message(GDBusConnection* connection,char* obj_path,char* method, char* error_msg)
+{
+	GDBusProxy *proxy;
+ 	GError *error;
+	GVariant *parm = NULL;
+	GVariant *result;
+	error = NULL;
+	proxy = g_dbus_proxy_new_sync (connection,
+                             G_DBUS_PROXY_FLAGS_NONE,
+                             NULL,                      /* GDBusInterfaceInfo* */
+                             "org.openbmc.control.Flash", /* name */
+                             obj_path, /* object path */
+                             "org.openbmc.Flash",        /* interface name */
+                             NULL,                      /* GCancellable */
+                             &error);
+	g_assert_no_error (error);
+
+	error = NULL;
+	if (strcmp(method,"error")==0) {
+		parm = g_variant_new("(s)",error_msg);
+	}
+	result = g_dbus_proxy_call_sync (proxy,
+                                   method,
+				   parm,
+                                   G_DBUS_CALL_FLAGS_NONE,
+                                   -1,
+                                   NULL,
+                                   &error);
+
+	g_assert_no_error (error);
+}
+
+
 static int program_file(FlashControl* flash_control, const char *file, uint32_t start, uint32_t size)
 {
 	int fd, rc;
@@ -175,7 +210,7 @@
 static void flash_access_setup_bmc(bool use_lpc, bool need_write)
 {
 	int rc;
-
+	printf("Setting up BMC flash\n");
 	/* Open and map devices */
 	open_devs(use_lpc, true);
 
@@ -220,6 +255,7 @@
 static void flash_access_setup_pnor(bool use_lpc, bool use_sfc, bool need_write)
 {
 	int rc;
+	printf("Setting up BIOS flash\n");
 
 	/* Open and map devices */
 	open_devs(use_lpc, false);
@@ -260,13 +296,13 @@
 	atexit(flash_access_cleanup_pnor);
 }
 
-int flash(FlashControl* flash_control,bool bmc_flash, char* write_file)
+uint8_t flash(FlashControl* flash_control,bool bmc_flash, char* write_file, char* obj_path)
 {
 	bool has_sfc = false, has_ast = false, use_lpc = true;
 	bool erase = true, program = true;
 	uint32_t address = 0;
 	int rc;
-
+	printf("flasher: %s, BMC = %d\n",write_file,bmc_flash);
 #ifdef __arm__
 	/* Check platform */
 	check_platform(&has_sfc, &has_ast);
@@ -275,15 +311,13 @@
 	if (bmc_flash) {
 		if (!has_ast) {
 			fprintf(stderr, "No BMC on this platform\n");
-			flash_control_emit_error(flash_control,write_file);
-			return;
+			return FLASH_ERROR;
 		}
 		flash_access_setup_bmc(use_lpc, erase || program);
 	} else {
 		if (!has_ast && !has_sfc) {
 			fprintf(stderr, "No BMC nor SFC on this platform\n");
-			flash_control_emit_error(flash_control,write_file);
-			return;
+			return FLASH_ERROR;
 		}
 		flash_access_setup_pnor(use_lpc, has_sfc, erase || program);
 	}
@@ -292,8 +326,7 @@
 			    &fl_total_size, &fl_erase_granule);
 	if (rc) {
 		fprintf(stderr, "Error %d getting flash info\n", rc);
-		flash_control_emit_error(flash_control,write_file);
-		return;
+		return FLASH_ERROR;
 	}
 #endif
 	if (strcmp(write_file,"")!=0)
@@ -302,32 +335,27 @@
 		struct stat stbuf;
 		if (stat(write_file, &stbuf)) {
 			perror("Failed to get file size");
-			flash_control_emit_error(flash_control,write_file);
-			return;
+			return FLASH_ERROR;
 		}
 		uint32_t write_size = stbuf.st_size;
 #ifdef __arm__
 		rc = erase_chip();
 		if (rc) {
-			flash_control_emit_error(flash_control,write_file);
-			return;
+			return FLASH_ERROR;
 		}
 		rc = program_file(flash_control, write_file, address, write_size);
 		if (rc) {
-			flash_control_emit_error(flash_control,write_file);
-			return;
+			return FLASH_ERROR;
 		}
 #endif
 	
-		flash_control_emit_done(flash_control,write_file);
-		//flash_control_emit_error(flash_control,write_file);
 		printf("Flash done\n");
 	}
 	else 
 	{
-		flash_control_emit_done(flash_control,write_file);
 		printf("Flash tuned\n");
 	}
+	return FLASH_OK;
 }
 
 static void
@@ -337,12 +365,12 @@
 {
 
 	cmdline *cmd = user_data;
-	if (cmd->argc < 2)
+	if (cmd->argc < 4)
 	{
-		g_print("No objects created.  Put object name and filename on command line\n");
+		g_print("flasher [flash name] [filename] [source object]\n");
 		return;
 	}
-	printf("Starting flasher\n");	
+	printf("Starting flasher: %s,%s,%s,\n",cmd->argv[1],cmd->argv[2],cmd->argv[3]);	
 	ObjectSkeleton *object;
   	manager = g_dbus_object_manager_server_new (dbus_object_path);
 	gchar *s;
@@ -361,7 +389,16 @@
 
 	/* Export all objects */
 	g_dbus_object_manager_server_set_connection (manager, connection);
-	flash(flash_control,false,cmd->argv[2]);
+	bool bmc_flash = false;
+	if (strcmp(cmd->argv[1],"bmc")==0) {
+		bmc_flash = true;
+	}
+	int rc = flash(flash_control,bmc_flash,cmd->argv[2],cmd->argv[3]);
+	if (rc == FLASH_ERROR) {
+		flash_message(connection,cmd->argv[3],"error","Flash Error");
+	} else {
+		flash_message(connection,cmd->argv[3],"done","");
+	}
 
 	//Object exits when done flashing	
 	g_main_loop_quit(cmd->loop);
