created json object from query
figured out colors
added add and sub pages
fixed php