FIX: do not redirect topic for JSON request

Do not redirect and track topic server side if the request format is JSON. cc @SamSaffron @eviltrout 

Also fixes https://github.com/discourse/discourse_api/issues/30