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.