move functions to more logical order after refactor
properly deal with 'only authenticated user' case in autocomplete