Implemented custom UserDetailsService

Added new functionality for work with DB.