Tightened up API response and added some sanity checks/error handling for states and years.