Add some track endpoints. Rewrite endpoint code