Added functionality to train from client.