Fix bug in the play function of the web api