Added support to throw 400 errors when node ID does not match the URI
Refactored json response back to the client