added display of incoming and outgoing invites

Also fixed bugs in invites create method and jQuery