Raise 404 for state object on invalid query format