api rpc server - search function now sends correct data

Now the search function in the server sends a list of files. The UI can now use the search function in the api server.