change database api to 'Monostate'