@GET
  @Path("/api/sessions/{id}/attempts")
  public RestSessionAttemptCollection getSessionAttempts(
      @PathParam("id") long id, @QueryParam("last_id") Long lastId)
      throws ResourceNotFoundException {

    ProjectStore rs = rm.getProjectStore(getSiteId());
    SessionStore ss = sm.getSessionStore(getSiteId());

    StoredSession session = ss.getSessionById(id);
    StoredProject project = rs.getProjectById(session.getProjectId());
    List<StoredSessionAttempt> attempts =
        ss.getAttemptsOfSession(id, 100, Optional.fromNullable(lastId));

    List<RestSessionAttempt> collection =
        attempts
            .stream()
            .map(attempt -> RestModels.attempt(session, attempt, project.getName()))
            .collect(Collectors.toList());

    return RestModels.attemptCollection(collection);
  }