refactor api_resolver to case statement since it reads nicer