setting up conditional and server request