Fix create challenge API + add some mocha tests