backend implement: Rewriting Authorization to be more independent and refactoring tests