prepared everything to fit into the js
Added a limit to the maximum number of friends

to reduce the time of retrieval and frequency of error messages