don't need to check everything before the HTTP
Revert "don't need to check everything before the HTTP"

This reverts commit cbbacc181060b0d65a88dba86ba0574ec4cd46e4.
Merge when unauthorized
Merge tests when Write authlevel is set
fix trivial bugs
fix trivial bug
add stub replace
Put tests