Partially implemented the invitation ajax.