Moved API functionality to helper class.