Added chat API to ChatAPI.php