adding json middleware