adding parse_request method for server