Updated to handle javascript services
Moved javascript to services