fixed transform routes to work with Ruby server; made it more modular