Merging some code from apiv2 to master (simlarity server utilities)
Fix merging confilcts with master