Throw RuntimeException for missing ref in search form

If you forget to set the ref for a search form, you'll get a 400 Error from the api for 'Bad Request'. By first checking existence of a ref before sending the request there's a clearer reason as to what went wrong and an HTTP request is saved.