clean up API response parsing. passably nice now