Added a bit more logic to the javascript mock