Fixed database api