Reorder methods
Merge duplicated code
Decode json with error verification
Print invalid json response