Updated the usage of db and rest