getMatchIds and getMatch functions

added error handling to getMatch