generate plots or return json responses via api