Added flow control API and demo