Javascript application which uses API