Implementation of /similarity REST endpoint

Can be final / package-private maybe?