static StreamTask jsonToTask(JSONObject taskJson) throws StreamIOException {
		try {
			String taskName = taskJson.getString(TaskKey.NAME);
			StreamTask task = new StreamTask(taskName);
			if (taskJson.has(TaskKey.DESCRIPTION)) {
				task.setDescription(taskJson.getString(TaskKey.DESCRIPTION));
			}

			if (taskJson.has(TaskKey.STARTTIME)) {
				Calendar startTime = Calendar.getInstance();
				Date startTimeDate = dateFormat.parse(taskJson
						.getString(TaskKey.STARTTIME));
				startTime.setTime(startTimeDate);
				task.setStartTime(startTime);
			}

			if (taskJson.has(TaskKey.DEADLINE)) {
				Calendar deadline = Calendar.getInstance();
				Date deadlineDate = dateFormat.parse(taskJson
						.getString(TaskKey.DEADLINE));
				deadline.setTime(deadlineDate);
				task.setDeadline(deadline);
			}

			if (taskJson.has(TaskKey.TAGS)) {
				JSONArray tagsJson = taskJson.getJSONArray(TaskKey.TAGS);
				for (int i = 0; i < tagsJson.length(); i++) {
					taskLogic.addTags(task, tagsJson.getString(i));
				}
			}

			if (taskJson.has(TaskKey.DONE)) {
				Boolean isDone = taskJson.getBoolean(TaskKey.DONE);
				if (isDone) {
					task.markAsDone();
				}
			}

			if (taskJson.has(TaskKey.RANK)) {
				task.setRank(taskJson.getString(TaskKey.RANK));
			}
			return task;
		} catch (JSONException | ParseException e) {
			throw new StreamIOException("JSON conversion failed - "
					+ e.getMessage(), e);
		}
	}