Change middlware methods to handle appropriate service

Ticket:	#4929