Map<String, String> resultMap = gson.fromJson(responseJson,
new TypeToken<Map<String, String>>() {
}.getType());
if (resultMap == null) {
throw new APIerrorMessage("Conversion from Json string returned null");
} else if (resultMap.get("error") != null) {
throw new APIerrorMessage(resultMap.get("error"));
} else {
// create a new task object and return
int taskId = Integer.parseInt(resultMap.get("id"));
Task newTask = this.getTask(taskId);