add query params to index function
upvote returns question
error middleware returns json