add lock, refactor model, adding web