Fix bug in challenges API

1. Fix error in old challenges api.
Merge pull request #264 from Ghost141/challenges_api_update

Fix bug in challenges API