Update csapi.rb

Changed returned @cookies, added message handling functions.