finish database api