Added API to clear database and assign the maxConcurrentOperations. Also fixed a retain cycle