api rest and chat