Fixed Json error and did general cleanup