Add DB check for users and devices