anchor.diff:    
     // Add an event handler to call the onSuccess function when the POST call is successful
     req.on.readyStateChange.add((Event e) {
  -    if (req.readyState == XMLHttpRequest.DONE && (req.status == 200)) {
  -      var j = JSON.parse(req.responseText);
  -      if (j.containsKey("data") && j["data"].containsKey("error"))
  -        print('HELL YEAH');
  -      else
  -        onSuccess(req);
  +    if (req.readyState == XMLHttpRequest.DONE) {
  +        if (req.status == 200) {
  +          var j = JSON.parse(req.responseText);
  +          if (j.containsKey("result_json")) {
  +            DivElement error = query('#error');
  +            error.style.display = 'none';
  +            onSuccess(req);
  +          }
  +          else {
  +            print('Error: City not found');
  +            query('#error_text').text = "City not found";
  +            DivElement error = query('#error');
  +            error.style.display = '';
  +          }
  +        }
  +        if (req.status == 401) {
  +          print('Error: User not logged in');
  +          query('#error_text').text = "User not logged in";
  +          DivElement error = query('#error');
  +          error.style.display = '';
  +        }
       }
     });
     
  
positive.code:   ImageElement image2 = query('#img2');
    image2.src = weatherToday["weatherIconUrl"][0]["value"];
    
    var weatherTomorrow = parsedJSON["data"]["weather"][1];
    query('#dateTomorrow').text = weatherTomorrow["date"];
    query('#description3').text = weatherTomorrow["weatherDesc"][0]["value"];
  
negative.code:   showJson(req);
  }
  
  // Function that shows the distinct forecast data in the corresponding elements
  void showJson(XMLHttpRequest req) {
    var parsedJSON = JSON.parse(req.responseText)["result_json"];
    
    // Current condition
    var currentConditions = parsedJSON["data"]["current_condition"][0];
    query('#observationTime').text = currentConditions["observation_time"];
    query('#description1').text = currentConditions["weatherDesc"][0]["value"];
  