Improved function for converting request to JSON
Fixed bug in parsing null request IDs
Simplified parsing of requests