Fixed typo in variable name. Moved route registration to separate method