Callback functionality

Added callback functionality that the user hook on the complete event.