Fix DB API

no ref
- Use correct error type