splits endpoint in separate files