Fix function name formatting.
Do not use response before checking error.
Minor formatting tweaks.