Add REST mode to API