Sortmerna api

App controller + accompanying unit tests
Probably useful to define an aux function to avoid code duplication