added common infrastructure for json error messages and test code for file uploads