handling api requests with SLIM library