Prototyping javascript for app