Better session layer implementation. Initial service layer implementation