Combine and simplify http calls and json marshal/unmarshaling