refactor(API): Move helpers to API class

Calling methods using self. is slightly faster than calling them
from a separate module or even in the same module without using
the self param.

The helpers for Request and Response were not moved because they
are either used for defining properties at import time or are
not on performance-sensitive code paths.

Closes #355