API changes

Reducing redundant redundancy, and handling errors centrally.