Invalid JSON is returned when request is not authorized