Add track record rest api & tests. Some fixes to existing apis.