Moved auto complete method  to controller

This concerns issue #2