fixed some service issues and moved more js to angular style