Moved REST API to separate file.