Separated search

- No more combined searching
- Added REST functions in rest.js file
- More error logging
- Fixed indention
- Added copyright on top of .js files
You can use the `_.find` utility function here, it breaks on the first item that passes the test and returns it, so you won't have to select the first item from the array lower down.