Add client side validations
Cleanup of javascript