Fix errors and adjust routes