Implemented database storage for the tokens.