Receives text posted in JSON, and trains classifier