@GET
  @UnitOfWork
  @Path("viewers/{personId}")
  @Produces(MediaType.APPLICATION_JSON)
  public LinkedList<Viewer> profileViews(@PathParam("personId") LongParam personId)
      throws JsonParseException, JsonMappingException, IOException {

    Person person = findSafely(personId.get());

    LinkedList<Viewer> viewers;

    if (person.getViewers() != null) {
      viewers = mapper.readValue(person.getViewers(), new TypeReference<LinkedList<Viewer>>() {});

      // send only valid views; which happened in last ten days
      // do not update person object for invalid views : update only in addProfile function
      LinkedList<Viewer> tmp = new LinkedList<Viewer>();
      for (Viewer viewer : viewers) {
        if (isValid(viewer)) tmp.add(viewer);
      }

      viewers = tmp;
    } else viewers = new LinkedList<Viewer>();

    return viewers;
  }
  @POST
  @UnitOfWork
  @Path("add_view/{personId}")
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  public synchronized Person addProfileView(
      @PathParam("personId") LongParam personId, Viewer viewer)
      throws JsonParseException, JsonMappingException, IOException {
    // load person object
    Person person = findSafely(personId.get());
    LinkedList<Viewer> viewers;

    // Pending: make sure the viewer Id exists in db

    if (viewer.getId() == personId.get())
      throw new BadRequestException("Viewer & viewee id's are same");

    if (person.getViewers() != null) {
      // de-serialise viewers object to list from json
      viewers = mapper.readValue(person.getViewers(), new TypeReference<LinkedList<Viewer>>() {});

      // filter invalid/obsolete views
      LinkedList<Viewer> tmp = new LinkedList<Viewer>();
      for (Viewer vr : viewers) {
        // if viewer is valid and not same as current one
        if (vr.getId() != viewer.getId() && isValid(vr)) tmp.add(vr);
      }

      // if max viewers are present; remove last one
      if (tmp.size() == maxViewers) tmp.removeLast();

      viewers = tmp;
    } else {
      viewers = new LinkedList<Viewer>();
    }

    // add new viewer
    viewers.addFirst(viewer);

    person.setViewers(mapper.writeValueAsString(viewers));

    personDAO.update(person);

    return person;
  }