Start to generalize JS part. Add routes to Restangular later