Move api.httpStream() to its own file