add error checking to MW api calls

https://sourceforge.net/p/workingwiki/bugs/267/