added json endpoint to invitations controller