Chat api controller