implemented authentication and authorization