fix invites and implement jbuilder in rails controller