Refactor API handlers.
Refactor API endpoints to method values.