removed ticket generation fn. refactored code for storing and fetching data, handled error cases.streamlines and formatted response from the fns.