Fix to the conditions when doing a restsearch

- Was always searching for 'value' due to a bug. Fixed.
Merge branch 'feature/searchapi' into develop