How to just show front page and message when search api search was queried with blank input
Here is a solution:

function MY_THEME_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  if($form_id == 'search_block_form' || $form_id == 'search_form') {
    array_unshift($form['#validate'], 'custom_search_validate');
  }
}

function custom_search_validate($form, &amp;$form_state) {
  dpm($form_state);
  if(isset($form_state['values']['search_block_form']) &amp;&amp; $form_state['values']['search_block_form'] == FALSE) {
    drupal_set_message('please enter the terms of the search', 'error');
    drupal_goto();
  }

  if(isset($form_state['values']['keys']) &amp;&amp; $form_state['values']['keys']
    == FALSE) {
    drupal_set_message('please enter the terms of the search', 'error');
    drupal_goto();
  }
}