added check challenge function to file and api