Fix query counter for request made by prepare method
Remove redundant query for not logged in user