Added a db method to check if a palette's exists with a given Id

This function will be used when we are generating a new `id` for a
palette