Since the errors are now always cleared upon rehydration of the
application state, we can now safely remove the api method
clearErrors() and also remove calls to this method.
Since errors are cleared before the state is rehydrated the
clearing of the errors are dismissed when rehydrating. Thus
we'll have to clear the errors whenever the state is being
rehydrated.
This has happened because the store was being updated before
it was rehydrated, and thus first saving an empty state, which
is thereafter being loaded when rehydrating the application state.
Since the state cannot be retrieved while the store has changes to be dispatched
the actual state (which is used for building the auth headers for requests) has
to be retrieved beforehand and given to the action as parameter.
Added login and registration api calls to the function pool,
while the application state is persistet through localStorage.
Also (if signed in) the username will be displayed in the
navigation bar of the website.