Finish authentication and authorization, fix Rubocop errors