A machine to machine, M2M, device for end-to-end service layer sessions, the end-to-end service layer sessions using a service layer session management function, the device comprising: a processor; and a memory (44, 46) coupled with the processor, the memory having stored thereon executable instructions that when executed by the processor cause the processor to effectuate operations comprising: receiving, from a session credential function, a session credential allocated to a service layer instance, the session credential being for an end-to-end, E2E, communication session, wherein the service layer instance, based on the session credential, provides services for the E2E communication session over multiple service layer hops and provides the M2M device with a value-added service for the E2E communication session, wherein the value-added service comprises a policy of whether data of the E2E communication session is allowed to be aggregated with other data; receiving a targeted session endpoint of the E2E communication session; providing a request to establish the E2E communication session, the request comprising the session credential and the targeted session endpoint; and receiving a response to the request, wherein: the response provides that the E2E communication session is established, and the response comprises service layer session state of the E2E communication session. a processor; and a memory (44, 46) coupled with the processor, the memory having stored thereon executable instructions that when executed by the processor cause the processor to effectuate operations comprising: receiving, from a session credential function, a session credential allocated to a service layer instance, the session credential being for an end-to-end, E2E, communication session, wherein the service layer instance, based on the session credential, provides services for the E2E communication session over multiple service layer hops and provides the M2M device with a value-added service for the E2E communication session, wherein the value-added service comprises a policy of whether data of the E2E communication session is allowed to be aggregated with other data; receiving a targeted session endpoint of the E2E communication session; providing a request to establish the E2E communication session, the request comprising the session credential and the targeted session endpoint; and receiving a response to the request, wherein: the response provides that the E2E communication session is established, and the response comprises service layer session state of the E2E communication session. receiving, from a session credential function, a session credential allocated to a service layer instance, the session credential being for an end-to-end, E2E, communication session, wherein the service layer instance, based on the session credential, provides services for the E2E communication session over multiple service layer hops and provides the M2M device with a value-added service for the E2E communication session, wherein the value-added service comprises a policy of whether data of the E2E communication session is allowed to be aggregated with other data; receiving a targeted session endpoint of the E2E communication session; providing a request to establish the E2E communication session, the request comprising the session credential and the targeted session endpoint; and receiving a response to the request, wherein: the response provides that the E2E communication session is established, and the response comprises service layer session state of the E2E communication session. the response provides that the E2E communication session is established, and the response comprises service layer session state of the E2E communication session.