Created Error class to create JSONObject error objects