Add get_history function to get ticket history

Also added many TODO's to improve performance of same