added more functionality, fixed routing