Made the authentication work
Adding authentication to API methods