restructing routes in file layout and condensing code. Also fix typeahead route