Refactored error checking for bad json and image data into a wrapper function for put,post,get, and patch methods
added in get and delete to wrapper functionality