Fixed issues with routing topics and posts and refactoring