Added state machine code to service requests.