bug fix for rel=instances response and middleware order

bug fix for rel=instances response 
bug fix for stub service middleware order