Fix bug in flush.
Add method getEngine in API.