Implementation of /similarity REST endpoint

Debated for a while on having this logic in model vs REST endpoint (at the cost of performance). Initially had this in model with lock iterating over Y matrix but again the thought process was since this is specific to /similarity it kind'a seemed sensible to have it in the REST endpoint and not pollute the model with custom business logic. It makes sense now to push this back into the model. Will do.