create middleware file to make things clean
standardize ways of generating appium responses to conform to jsonwp
also handle case where an Error object is passed into handler