Working with database, autorization and repositories