Refactored API-calls and added search as well