QueryBuffer should be responsible for flushing.  Also add ability to have prefix in case multiple APIs are being imported into the same DB