add ensurance of json request when using token authentication