cleaned up js code and added single routes