fix (server crash on homepage)

Divided main & home.js because while on homepage, it sent  empty
request to server resulting in a crash