Refactor: Separated API functionality