checkAuthentication function

Checks whether the authentication is supported by the server and handles the different POST request routes.