REST API returns empty dictionaries for OPTIONS and HEAD request method