added tests for localStorage and added 401 error code to mock error from server
using setItem() on localStorage instead of calling it by key in hash