Small fix
Use SqlApi
Refactor