Check if a search term is given before saving it

Problem:
- Click in the search input and don't fill in anything
- Click away
-> 400 error

I just added a simple check to see if the search term was filled in before doing the ajax call.