flatmap to handle Some(None) and return empty json for URLs that do not exist in the API