changed api.js to simplify queries possible for testing, changed how the promise is handled in search.js to use .then,