Improving maps type checking for API