FTS-12: Check provided id and credentials id

Before doing anything. Even then, use only internal id for db operations.