Implementation of /similarity REST endpoint