Improve API related to the Token entity. Improve http 400 error message. Fix broken tests.