Update routes.js to fix minor bug

This change should fix a bug when the server side has routes with the same path but a different httpMethod (the rest-api in my case).