Wiring in server side token granting
Minor code cleanup