Refactoring

Throw an error if no challenges were found or wrong ids have been given in the params (i.e. in the url)