Added error logic

Also fixed bug with completion
Working on complete notifications as part of the stream.

TODO: debugging and classes containing the mutable state.
Fixed issues with completion