Bug fixes for route middleware and json content types.