proposed resolution for bug 997817
adding missing early return
regex typo, should be double =
correcting typo
simpler regex, better error handling on makeapi arror