Fix bug in challenges API

1. Fix error in old challenges api.