Dependency injection for stream
Commit
Moved api.php to root folder
more unit tests
unit tests